package zuoye_3_10;

import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;

//*  3.   
//*  "dasdsawqeqw"  1 
//*   输出:
//*   e 
//*   "dasdsawqeqw"  2
//*   输出:
//*   d
//*   a
//*   s
//*   w
//*   q
public class Zuoye_3 {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String str = sc.next();
		System.out.println("输入你要找到出现几次的");
		int n = sc.nextInt();
		Map<Object, Integer> map = new HashMap<>();
		for(char c:str.toCharArray()) {
			if (map.containsKey(c)) {
                map.put(c, map.get(c) + 1);
            } else {
                map.put(c, 1);
            }
		}
		 for(Entry<Object, Integer> num : map.entrySet()) {
	            if(num.getValue() == n) {
	                System.out.println(num.getKey());
	            }
	        }
	}
}
